/*
 * @Author: Vorga
 * @LastEditors: Vorga
 */
#ifndef ORDER_TREE_H
#define ORDER_TREE_H

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

#include "tree_node.h"
//有序二叉树 线索二叉树

void _add_ot(TreeNode **tree,TreeNode *node);

void add_ot(TreeNode **tree,void* data);

bool del_ot(TreeNode **tree,void* data,CMP cmp);

bool mod_val_ot(TreeNode **tree,void* old_data,void* new_data,CMP cmp);

TreeNode* _query_val_ot(TreeNode* tree,void* data,CMP cmp);

void* query_val_ot(TreeNode *tree,void* data,CMP cmp);
//有序二叉树的倒数第K个结点
void rdl_last_k_ot(TreeNode* tree, int *index,FUNC show);

void _create_cot(TreeNode* tree);

void create_cot(TreeNode* tree);

void clue_cot(TreeNode* tree,FUNC show);

void cal_height_lt(TreeNode *root);
#endif // ORDER_TREE_H
